def prompt()
print "=>"
end


def death
puts "You always a handsome boy,Game over!"
Process.exit
end

def night
puts "which clothes do you like?"
  prompt()
  likes = gets.chomp
  
  if likes == "red"
    puts "Yes, this is so beautiful!"
    Process.exit
  elsif likes == "green"
    puts "Green is nice ,but it not fit you."
    return :death
  else 
    puts "Why you like that ? I can't understand you."
    return :white
  end
end

def white
puts "what kind of sport do you like?"
   prompt()
   sport = gets.chomp

  if sport == "Basketball"
    puts "Oh, I like Allen Iverson very much, and I always play basketball when I in school."
    return :death
  elsif sport == "Football"
    puts "I want see China win the championship, But I'm afraid when I die China still so rubbish."
    return :death
  elsif sport == "ping-pongball"
    puts "Yes ,this is a game easy and China win a lot of cup as a prize,I like it."
    return :death
  else 
    puts "Eh, I don't like it."
    Process.exit
  end
end


def start()
puts "Hello boy, let me ask you some questions"
puts "Which time do you want go out? white or night?"
  prompt()
  
  time = gets.chomp
  if time == "white"
    white
  elsif time == "night"
    night
  else
    death
  end 
end

start()

# 昨天写的完全不能运行，现在改的可以正常达到效果了，但是里面还是没有把hash添加进去，昨天看了下hash相关的东西，hash就所通过把关键码值映射到一个位置来访问记录，以加快查找的速度，映射函数叫做散列函数，用hash进行查询的时候，通过关键码值获取到对应的映射值
#你能这么去找就不错， 至于什么是散列函数， 可以以后再去了解， 知道 hash的这个原理就行了暂时， 其他的继续学吧， 每天 两小时， 认真 点就行， 熬夜用处 不大的

